<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对话框</title>
</head>
<body>

    <h1>弹出对话框</h1>

    <!-- unordered list -->
    <ul>
        <!-- list item -->
        <li>带有输入框的对话框: prompt( message ) </li>
        <li>带有确定按钮和取消按钮的对话框: confirm( message ) </li>
        <li>带有禁告信息的对话框: alert( message )</li>
    </ul>

    <script type="text/javascript">
    
        let name = window.prompt( '请输入你的姓名' );
        console.log( name );

        let married = window.confirm( '你结婚了吗?' );
        console.log( married );

        if( married ) {
            window.alert( `很遗憾，对于${name}来说，我是没机会下手了` );
        } else {
            window.alert( `太好了，可以对${name}下手了` );
        }
    </script>
    
</body>
</html>